// 引入SDK核心类
var QQMapWX = require('./qqmap-wx-jssdk.js');
var qqmapsdk;


var addressdata = function() {
	return new Promise((resolve, reject) => {
		// 实例化API核心类
		qqmapsdk = new QQMapWX({
			key: 'ZK3BZ-RZZ3K-AQEJT-AIEGI-JXUZ7-LYFTZ'
		});
		//位置坐标，默认获取当前位置
		qqmapsdk.reverseGeocoder({
			success: res => {
				console.log("腾讯地图测试:", res)
				resolve(res.result.ad_info.city)
			},
			fail: err => {
				console.log(err)
				reject("杭州市")
			}
		})

	})
}

module.exports={
	addressdata
}